import request from '@/utils/httpRequset/js_sdk/request'
import store from '@/store'

const USERSERVICE = '/user-app-service/private/EiUser';
const SERVICE = '/user-app-service/private/service';
const PURSE = '/user-app-service/private/purse';
const TASK = '/user-app-service/private/task';
const MALL = '/user-app-service/private/mall';

const SSO = '/service-sso/public';
const CMS = '/ei-cms/public/mobile';
const PAY = '/payment-service/private/payment';
// /service-order-center/requestUserRechargeOrder
const SERVICEORDERCENTER = '/service-order-center/private';

const HEALTHCENTER = '/health-data-center/private';
// 新版数据中心
const REGHEALTHCENTER = store.state.regDataCenterApi;

const api = {
	// EI-sso
	requestVerify: SSO + '/requestVerification',
	login: SSO + '/login',
	getToken: SSO + '/getToken',
	updateAppSecret: SSO + '/updateAppSecret',
	thirdPartyAuth: SSO + '/thirdPartyAuth/login', //第三方登陆
	// 数据中心
	// fastCheck: HEALTHCENTER + '/fastCheck',
	requireCurrentReport: HEALTHCENTER + '/requireCurrentReport',
	// deepMonitor: HEALTHCENTER + '/deepMonitor',
	// createUserModel: HEALTHCENTER + '/createUserModel',
	// getUserModel: HEALTHCENTER + '/getUserModel',
	// getHistoryReport: HEALTHCENTER + '/getHistoryReport',
	// getTrend: HEALTHCENTER + '/getTrend',
	// saveReport: HEALTHCENTER + '/saveReport',
	deepWarning: HEALTHCENTER + '/deepWarning', //紧急情况通知
	// getImpWaveByReportId: HEALTHCENTER + '/getImpWaveByReportId', //获取数据解读
	//新版数据中心
	getTrend: REGHEALTHCENTER + '/getTrend',
	fastCheck: REGHEALTHCENTER + '/fastCheck',
	deepMonitor: REGHEALTHCENTER + '/deepMonitor',
	getUserModel: REGHEALTHCENTER + '/getUserModel',
	createUserModel: REGHEALTHCENTER + '/createUserModel',
	getHistoryReport: REGHEALTHCENTER + '/getHistoryReport',
	checkWave: REGHEALTHCENTER + '/checkWave',
	saveReport: REGHEALTHCENTER + '/saveReport',
	currentRegEvaluation: REGHEALTHCENTER + '/currentRegEvaluation', //根据REG数据评估当前血流状态
	createDeepMonitor: REGHEALTHCENTER + '/createDeepMonitor',  //深度监测创建开始任务
	completeDeepMonitor: REGHEALTHCENTER + '/completeDeepMonitor',  //完成深度监测任务
	getImpWaveByReportId: REGHEALTHCENTER + '/getRegParameterByReportId', //获取数据解读
	getRegReportEvaluationByReportId: REGHEALTHCENTER + '/getRegReportEvaluationByReportId',
	getReportStatus: REGHEALTHCENTER + '/getReportStatus',
	// 用户信息
	setLoginSecret: USERSERVICE + '/setLoginSecret',
	getUserInfo: USERSERVICE + '/getUserInfo',
	updateEiUserInfo: USERSERVICE + '/updateEiUserInfo',
	updateEiUserPhone: USERSERVICE + '/updateEiUserPhone',
	getHeadshot: USERSERVICE + '/getHeadshot',
	hasCheckAuth: USERSERVICE + '/hasCheckAuth',
	getMusicList: '/user-app-service/public/EiUser/getMusicList',
	// 服务信息
	bindService: SERVICE + '/bindService',
	unbindService: SERVICE + '/unbindService',
	getServiceInfo: SERVICE + '/getServiceInfo',
	getTodayUseTime: SERVICE + '/getTodayUseTime',
	getServiceUserList: SERVICE + '/getServiceUserList',
	bindServiceForOthers: SERVICE + '/bindServiceForOthers',
	slaveUserLogin: SERVICE + '/slaveUserLogin', //子用户登录
	// 任务相关
	userDailySignIn: TASK + '/userDailySignIn',
	userTask: TASK + '/userTask',
	dailyTask: TASK + '/daily', //日常任务操作
	// 获取钱包信息
	getPurseInfo: PURSE + '/getPurseInfo',
	getServicePurseFlowRecord: PURSE + '/getServicePurseFlowRecord',
	getUserPurseFlowRecord: PURSE + '/getUserPurseFlowRecord',
	rechargeServicePurse: PURSE + '/rechargeServicePurse',
	rechargeUserPurse: PURSE + '/rechargeUserPurse', //用户钱包充值
	// CMS
	getContent: CMS + '/getContent', //获取文章
	getAdviceOnRecuperation: CMS + '/getAdviceOnRecuperation', //获取建议 
	// 支付相关
	JSApiPay: PAY + '/JSApiPay',
	code2Session: PAY + '/code2Session',
	// 订单中心
	requestUserRechargeOrder: SERVICEORDERCENTER + '/requestUserRechargeOrder',
	// 查询订单状态
	getOrderInfo: SERVICEORDERCENTER + '/getOrderInfo',
	// 商城相关 api
	getIndexBanner: '/user-app-service/public/mall/getIndexBanner', //获取商城首页轮播图
	getGoodsList: '/user-app-service/public/mall/getGoodsList',
	getMyorderList: MALL + '/getMyOrderList',
	requestMallOrder: MALL + '/requestMallOrder',
	cancelOrder: MALL + '/cancelOrder',
	confirmReceipt: MALL + '/confirmReceipt', //确认收货
	getVoiceWithStream: '/service-aliyun-tts/private/getVoiceWithStream', //用流的方式获取音频
	getVoiceWithFileUrl: '/service-aliyun-tts/private/getVoiceWithFileUrl', //用文件的方式获取音频
	getVoiceWithBase64: '/service-aliyun-tts/private/getVoiceWithBase64', //用base64的方式获取音频
	getVoiceRequestInfo: '/service-aliyun-tts/private/getVoiceRequestInfo',
	userDeviceIdError: '/service-third-party-auth/private/thirdPartyAuth/userDeviceIdError', //上报用户id错误的信息
	getServiceWeekRecord: '/user-app-service/private/service/getServiceWeekRecord', // 获取5/7用户签到记录
	getServiceWeekHistoryRecord: '/user-app-service/private/service/getServiceWeekHistoryRecord', //获取服务5/7日任务历史完成情况记录
}

// 获取验证码 登录处
export function requestVerify(data) {
	return request.post(api.requestVerify, data);
}

export function login(data) {
	return request.post(api.login, data);
}

export function thirdPartyAuth(data) {
	return request.post(api.thirdPartyAuth, data);
}

export function setLoginSecret(data) {
	return request.post(api.setLoginSecret, data);
}

export function getUserInfo(data) {
	return request.post(api.getUserInfo, data);
}

export function updateEiUserInfo(data) {
	return request.post(api.updateEiUserInfo, data);
}

export function updateAppSecret(data) {
	return request.post(api.updateAppSecret, data);
}

export function getToken(data) {
	return request.post(api.getToken, data);
}

export function getUserModel(data) {
	return request.post(api.getUserModel, data);
}
export function createUserModel(data) {
	return request.post(api.createUserModel, data);
}

export function fastCheck(data) {
	return request.post(api.fastCheck, data);
}

export function deepMonitor(data) {
	return request.post(api.deepMonitor, data);
}

export function checkWave(data) {
	return request.post(api.checkWave, data);
}

export function currentRegEvaluation(data) {
	return request.post(api.currentRegEvaluation, data);
}

export function requireCurrentReport(data) {
	return request.post(api.requireCurrentReport, data);
}

export function getHistoryReport(data) {
	return request.post(api.getHistoryReport, data);
}
// saveReport
export function saveReport(data) {
	return request.post(api.saveReport, data);
}
// getImpWaveByReportId
export function getImpWaveByReportId(data) {
	return request.post(api.getImpWaveByReportId, data);
}

export function getRegReportEvaluationByReportId(data) {
	return request.post(api.getRegReportEvaluationByReportId, data);
}

export function getReportStatus(data) {
	return request.post(api.getReportStatus, data);
}
// 获取验证码 更换手机号处
export function updateEiUserPhone(data) {
	return request.post(api.updateEiUserPhone, data);
}

// 获取用户头像
export function getHeadshot(data) {
	return request.post(api.getHeadshot, data);
}

export function hasCheckAuth(data) {
	return request.post(api.hasCheckAuth, data);
}
// 获取音乐列表 getMusicList
export function getMusicList(data) {
	return request.post(api.getMusicList, data);
}

// 获取今日使用时长
export function getTodayUseTime(data) {
	return request.post(api.getTodayUseTime, data);
}

// 获取服务信息
export function getServiceInfo(data) {
	return request.post(api.getServiceInfo, data);
}
// bindService绑定头环
export function bindService(data) {
	return request.post(api.bindService, data);
}

// 获取服务账户绑定的用户信息
export function getServiceUserList(data) {
	return request.post(api.getServiceUserList, data);
}

//  解绑
export function unbindService(data) {
	return request.post(api.unbindService, data);
}
// 添加子用户bindServiceForOthers
export function bindServiceForOthers(data) {
	return request.post(api.bindServiceForOthers, data);
}

//子用户登录 slaveUserLogin
export function slaveUserLogin(data) {
	return request.post(api.slaveUserLogin, data);
}

// getTrend
export function getTrend(data) {
	return request.post(api.getTrend, data);
}

//获取钱包信息
export function getPurseInfo(data) {
	return request.post(api.getPurseInfo, data);
}

// 获取服务钱包明细
export function getServicePurseFlowRecord(data) {
	return request.post(api.getServicePurseFlowRecord, data);
}

// 获取用户钱包明细
export function getUserPurseFlowRecord(data) {
	return request.post(api.getUserPurseFlowRecord, data);
}
// 购买监测爱豆
export function rechargeServicePurse(data) {
	return request.post(api.rechargeServicePurse, data);
}
//rechargeUserPurse
export function rechargeUserPurse(data) {
	return request.post(api.rechargeUserPurse, data);
}

// 任务 userDailySignIn
export function userDailySignIn(data) {
	return request.post(api.userDailySignIn, data);
}
// userTask
export function userTask(data) {
	return request.post(api.userTask, data);
}
// dailyTask
export function dailyTask(data) {
	return request.post(api.dailyTask, data);
}

// 获取文章 内容 cms getContent
export function getContent(data) {
	return request.post(api.getContent, data);
}
// 获取建议相关的内容
export function getAdviceOnRecuperation(data) {
	return request.post(api.getAdviceOnRecuperation, data);
}

/* 支付 */
export function JSApiPay(data) {
	return request.post(api.JSApiPay, data);
}
// code2Session 
export function code2Session(data) {
	return request.post(api.code2Session, data);
}
// 订单中心  requestUserRechargeOrder
export function requestUserRechargeOrder(data) {
	return request.post(api.requestUserRechargeOrder, data);
}
// 查询订单状态 getOrderInfo
export function getOrderInfo(data) {
	return request.post(api.getOrderInfo, data, {
		load: true
	});
}

/*  商城相关api  */
// 获取商城首页轮播图
export function getIndexBanner(data) {
	return request.post(api.getIndexBanner, data);
}
//获取已上架的商品信息
export function getGoodsList(data) {
	return request.post(api.getGoodsList, data);
}
// 获取订单列表
export function getMyorderList(data) {
	return request.post(api.getMyorderList, data);
}
// 请求 订单
export function requestMallOrder(data) {
	return request.post(api.requestMallOrder, data);
}
export function cancelOrder(data) {
	return request.post(api.cancelOrder, data);
}
// 确认收货
export function confirmReceipt(data) {
	return request.post(api.confirmReceipt, data);
}
// getVoiceWithStream  获取音频
export function getVoiceWithStream(data) {
	return request.post(api.getVoiceWithStream, data);
}
// getVoiceWithBase64
export function getVoiceWithBase64(data) {
	return request.post(api.getVoiceWithBase64, data);
}
// getVoiceWithFileUrl
export function getVoiceWithFileUrl(data) {
	return request.post(api.getVoiceWithFileUrl, data);
}

//getVoiceRequestInfo
export function getVoiceRequestInfo(data) {
	return request.post(api.getVoiceRequestInfo, data);
}

// deepWarning 紧急通知
export function deepWarning(data) {
	return request.post(api.deepWarning, data);
}

export function userDeviceIdError(data) {
	return request.post(api.userDeviceIdError, data);
}

export function getServiceWeekRecord(data) {
	return request.post(api.getServiceWeekRecord, data);
}

export function getServiceWeekHistoryRecord(data) {
	return request.post(api.getServiceWeekHistoryRecord, data);
}

export function createDeepMonitor(data) {
	return request.post(api.createDeepMonitor, data);
}

export function completeDeepMonitor(data) {
	return request.post(api.completeDeepMonitor, data);
}